package com.code.day14;

import java.util.Calendar;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个年份:");
        int year = sc.nextInt();
        Calendar cal = Calendar.getInstance();
        cal.set(year,2,1);
        cal.add(Calendar.DATE, -1);
        int day = cal.get(Calendar.DATE);
        if (day == 29){
            System.out.println(year+"是闰年");
            System.out.println("今年有366天");
        }else{
            System.out.println(year+"是平年");
            System.out.println("今年有365天");
        }
        }

}

